sampler TextureSampler : register(s0);

int screenWidth = 800;
int screenHeight = 600;

float4 main(float2 texCoord : TEXCOORD0) : COLOR0
{
    float ux = 1.0 / screenWidth;
    float uy = 1.0 / screenHeight;

    float4 tex = tex2D(TextureSampler, texCoord) * 0.5;
    float4 tex2 = tex2D(TextureSampler, float2(texCoord.x, texCoord.y - uy)) * 0.125;
    float4 tex3 = tex2D(TextureSampler, float2(texCoord.x - ux, texCoord.y)) * 0.125;
    float4 tex4 = tex2D(TextureSampler, float2(texCoord.x + ux, texCoord.y)) * 0.125;
    float4 tex5 = tex2D(TextureSampler, float2(texCoord.x, texCoord.y + uy)) * 0.125;
    tex = tex + tex2 + tex3 + tex4 + tex5;

    return tex;
}

technique
{
    pass
    {
        PixelShader = compile ps_2_0 main();
    }
}
